<?php

/**
 * UserAccountCashRecord form base class.
 *
 * @method UserAccountCashRecord getObject() Returns the current form's model object
 *
 * @package    vmdai
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseUserAccountCashRecordForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'user_id'       => new sfWidgetFormInputText(),
      'current_money' => new sfWidgetFormInputText(),
      'next_money'    => new sfWidgetFormInputText(),
      'fee'           => new sfWidgetFormInputText(),
      'status'        => new sfWidgetFormInputText(),
      'user_bank_id'  => new sfWidgetFormInputText(),
      'verified_time' => new sfWidgetFormInputText(),
      'serial_id'     => new sfWidgetFormInputText(),
      'dealing_id'    => new sfWidgetFormInputText(),
      'is_return'     => new sfWidgetFormInputText(),
      'reason'        => new sfWidgetFormInputText(),
      'ip'            => new sfWidgetFormInputText(),
      'created_at'    => new sfWidgetFormDateTime(),
      'updated_at'    => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'user_id'       => new sfValidatorInteger(),
      'current_money' => new sfValidatorNumber(),
      'next_money'    => new sfValidatorNumber(),
      'fee'           => new sfValidatorNumber(),
      'status'        => new sfValidatorInteger(array('required' => false)),
      'user_bank_id'  => new sfValidatorInteger(array('required' => false)),
      'verified_time' => new sfValidatorPass(array('required' => false)),
      'serial_id'     => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'dealing_id'    => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'is_return'     => new sfValidatorInteger(array('required' => false)),
      'reason'        => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'ip'            => new sfValidatorString(array('max_length' => 250, 'required' => false)),
      'created_at'    => new sfValidatorDateTime(),
      'updated_at'    => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('user_account_cash_record[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'UserAccountCashRecord';
  }

}
